package com.ql.gamelogm.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
public class SearchBtnController {
    /*查找搜索按钮*/
    @RequestMapping(value = "/searchredict")
    @ResponseBody
    public ModelAndView searchRedictto(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse){
        ModelAndView modelAndView = new ModelAndView();
        String RedictUrl=httpServletRequest.getParameter("search").trim();
        switch (RedictUrl){
            case "日志抓取":
                modelAndView.setViewName("LogCatch");
                break;
            case "日志分析":
                modelAndView.setViewName("LogAnalysis");
                break;
            case "日志报警":
                modelAndView.setViewName("LogWarn");
                break;
            case "权限管理":
                modelAndView.setViewName("SysRight");
                break;
            case "人员管理":
                modelAndView.setViewName("PersRight");
                break;
            case "日历":
                modelAndView.setViewName("calendar");
                break;
            case "邮箱":
                modelAndView.setViewName("emailinbox");
                break;
            default:
                modelAndView.setViewName("index");
        }
        return modelAndView;
    }
}
